<%--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.opensymphony.xwork2.util.ValueStack"%>
<%@page import="com.lynn.salary.entity.EmpSalaryItem"%>
<%@page import="com.lynn.salary.util.ToolMethod"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%
	ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");
	List<EmpSalaryItem> empSal = (List<EmpSalaryItem>)vs.findValue("empSal");
	String empId = vs.findString("empId");
	String empName = vs.findString("empName");
	String rid = ToolMethod.getCharAndNumr(10);
	String imgId = ToolMethod.getCharAndNumr(10);
%>
<style>
<!--
.lynn-mytable-asignEmp-3232 { 
padding: 10px; 
margin-top: 10px;
width: 370px;
} 

th.assignEmp-adfaji { 
font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; 
color: #4f6b72; 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
border-top: 1px solid #C1DAD7; 
text-align: left; 
background: #CAE8EA  no-repeat; 
padding-top:6px;
padding-bottom:6px;
padding-left:12px;

} 

td.assignEmp-row23 { 
border-right: 1px solid #C1DAD7; 
border-bottom: 1px solid #C1DAD7; 
background: #fff; 
font-size:12px; 
padding-top:6px;
padding-bottom:6px;
padding-left:12px;
color: #4f6b72; 
} 
-->
</style>

<table class="lynn-mytable-asignEmp-3232" cellspacing="0">
	<thead>
		<tr>
			<th class="assignEmp-adfaji" scope="col">名字</th>	
			<th class="assignEmp-adfaji" scope="col">金额</th>	
			<th class="assignEmp-adfaji" scope="col">操作</th>
		</tr>
	</thead>
	<tbody>
<%
	for(EmpSalaryItem item : empSal) {
		String amount = item.getAmount() == null ? " - " : item.getAmount()+"";
%>
	<tr>
		<td class="assignEmp-row23" rid="<%=rid %>" itemname="<%=item.getName() %>">
			<%=item.getName() %>
		</td>
		<td class="assignEmp-row23">
			<%=amount %>
		</td>
		<td class="assignEmp-row23">
			<img alt="查看" src="<%=basePath %>images/005.jpg" style="cursor:pointer;">
			<img alt="编辑" src="<%=basePath %>images/006.jpg" style="cursor:pointer;">
			<img alt="删除" imgId=<%=imgId %> src="<%=basePath %>images/004.png" style="cursor:pointer;" itemId="<%=item.getId() %>">
		</td>
	</tr>
<%
	}
%>
	</tbody>
</table>
<br/>
注：
<img alt="查看" src="<%=basePath %>images/005.jpg" style="width: 14px;height: 14px;">查看
<img alt="编辑" src="<%=basePath %>images/006.jpg" style="width: 14px;height: 14px;">编辑
<img alt="删除" src="<%=basePath %>images/004.png" style="width: 14px;height: 14px;">删除
<script>
var curEmpId = "<%=empId %>";
var curEmpName = "<%=empName %>";
if(typeof lynn == "undefined") {
	lynn = {};
}
lynn.curEmpCb2323 = function (type,typeId,name) {
	if(type == "d") {
		var flag = false;
		$("td[rid=<%=rid%>]").each(function (idx,elem){
			if($(this).attr("itemname") == name){
				flag = true;
				alert(name+"已分配");
				return false;
			};
		});


		if(!flag) {

			$.ajax({
				url:"<%=basePath %>emp!assignSalaryItem.do?flag="+type+"&itemId="+typeId+"&empId="+curEmpId+"&empName="+curEmpName
			}).done(function(data){
				if($.trim(data) == "success") {
					//刷新emp面板
					$.ajax({
						  url: "<%=basePath%>emp!curEmp.do?empId="+curEmpId+"&empName="+curEmpName
						}).done(function ( data ) {
							$("#lynn-salary-Asign-emp-4").html(curEmpName);
							$("#lynn-salary-Asign-emp-4af").html(data);
						});
					
				} else {
					alert("分配失败");
				}
			});
		}
		
	} else if(type == "q") {
		if(!confirm("将与该员工现有工资项合并,确认要这样做?"))return;
		
		$.ajax({
			  url: "<%=basePath%>emp!assignSalaryItem.do?empId="+curEmpId+"&empName="+curEmpName+"&itemId="+typeId+"&flag=q"
			}).done(function ( data ) {
				if($.trim(data) == "success") {
				$.ajax({
					  url: "<%=basePath%>emp!curEmp.do?empId="+curEmpId+"&empName="+curEmpName
					}).done(function ( data ) {
						$("#lynn-salary-Asign-emp-4").html(curEmpName);
						$("#lynn-salary-Asign-emp-4af").html(data);
					});
				} else {
					alert("分配失败");
				}
				
			});
	}
}

$("img[imgId=<%=imgId %>]").click(function(event){
	var sid = $(this).attr("itemId");	
	var  r  = confirm("确认要删除?");
	if(!r)return;
	$.ajax({
		  url: "<%=basePath%>emp!assignSalaryItem.do?empId="+curEmpId+"&empName="+curEmpName+"&itemId="+sid+"&flag=rm"
		}).done(function ( data ) {
			if($.trim(data) == "success") {
				//刷新emp面板
			$.ajax({
				  url: "<%=basePath%>emp!curEmp.do?empId="+curEmpId+"&empName="+curEmpName
				}).done(function ( data ) {
					$("#lynn-salary-Asign-emp-4").html(curEmpName);
					$("#lynn-salary-Asign-emp-4af").html(data);
				});
			} else {
				alert("删除失败");
			}
		});
});

</script>--%>